home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / vala.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  7KB  |  223 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: John Luke <jluke@cfl.rr.com>
  5.  Copyright (C) 2003 John Luke <jluke@cfl.rr.com>
  6.  Copyright (C) 2004 Jeroen Zwartepoorte <jeroen@xs4all.nl>
  7.  Copyright (C) 2004 Alessio Frusciante <algol@firenze.linux.it>
  8.  Copyright (C) 2005 Brion Vibber <brion@pobox.com>
  9.  Copyright (C) 2007-2008 J├╝rg Billeter <j@bitron.ch>
  10.  
  11.  This library is free software; you can redistribute it and/or
  12.  modify it under the terms of the GNU Library General Public
  13.  License as published by the Free Software Foundation; either
  14.  version 2 of the License, or (at your option) any later version.
  15.  
  16.  This library is distributed in the hope that it will be useful,
  17.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19.  Library General Public License for more details.
  20.  
  21.  You should have received a copy of the GNU Library General Public
  22.  License along with this library; if not, write to the
  23.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  24.  Boston, MA 02111-1307, USA.
  25.  
  26. -->
  27. <language id="vala" name="Vala" version="2.0" _section="Sources">
  28.   <metadata>
  29.     <property name="mimetypes">text/x-vala</property>
  30.     <property name="globs">*.vala</property>
  31.     <property name="line-comment-start">//</property>
  32.     <property name="block-comment-start">/*</property>
  33.     <property name="block-comment-end">*/</property>
  34.   </metadata>
  35.  
  36.   <styles>
  37.     <style id="comment" _name="Comment" map-to="def:comment"/>
  38.     <style id="error" _name="Error" map-to="def:error"/>
  39.     <style id="type" _name="Data Type" map-to="def:type"/>
  40.     <style id="string" _name="String" map-to="def:string"/>
  41.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  42.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  43.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  44.     <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
  45.     <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
  46.     <style id="real" _name="Real number" map-to="def:floating-point"/>
  47.   </styles>
  48.  
  49.   <definitions>
  50.  
  51.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  52.       <start>//</start>
  53.       <include>
  54.         <context ref="def:in-line-comment"/>
  55.       </include>
  56.     </context>
  57.  
  58.     <context id="multiline-comment" style-ref="comment">
  59.       <start>/\*</start>
  60.       <end>\*/</end>
  61.       <include>
  62.         <context ref="def:in-comment"/>
  63.       </include>
  64.     </context>
  65.  
  66.     <context id="close-comment-outside-comment" style-ref="error">
  67.       <match>\*/(?!\*)</match>
  68.     </context>
  69.  
  70.     <context id="multiline-string" style-ref="string">
  71.       <start>@"([^"]|"")*</start>
  72.       <end>"</end>
  73.       <include>
  74.         <context ref="def:escape"/>
  75.         <context ref="def:line-continue"/>
  76.       </include>
  77.     </context>
  78.  
  79.     <context id="keywords" style-ref="keyword">
  80.       <keyword>class</keyword>
  81.       <keyword>delegate</keyword>
  82.       <keyword>enum</keyword>
  83.       <keyword>errordomain</keyword>
  84.       <keyword>interface</keyword>
  85.       <keyword>namespace</keyword>
  86.       <keyword>signal</keyword>
  87.       <keyword>struct</keyword>
  88.       <keyword>using</keyword>
  89.       <!-- modifiers -->
  90.       <keyword>abstract</keyword>
  91.       <keyword>const</keyword>
  92.       <keyword>dynamic</keyword>
  93.       <keyword>extern</keyword>
  94.       <keyword>inline</keyword>
  95.       <keyword>out</keyword>
  96.       <keyword>override</keyword>
  97.       <keyword>private</keyword>
  98.       <keyword>protected</keyword>
  99.       <keyword>public</keyword>
  100.       <keyword>ref</keyword>
  101.       <keyword>static</keyword>
  102.       <keyword>virtual</keyword>
  103.       <keyword>volatile</keyword>
  104.       <keyword>weak</keyword>
  105.       <!-- others -->
  106.       <keyword>as</keyword>
  107.       <keyword>base</keyword>
  108.       <keyword>break</keyword>
  109.       <keyword>case</keyword>
  110.       <keyword>catch</keyword>
  111.       <keyword>construct</keyword>
  112.       <keyword>continue</keyword>
  113.       <keyword>default</keyword>
  114.       <keyword>delete</keyword>
  115.       <keyword>do</keyword>
  116.       <keyword>else</keyword>
  117.       <keyword>ensures</keyword>
  118.       <keyword>finally</keyword>
  119.       <keyword>for</keyword>
  120.       <keyword>foreach</keyword>
  121.       <keyword>get</keyword>
  122.       <keyword>if</keyword>
  123.       <keyword>in</keyword>
  124.       <keyword>is</keyword>
  125.       <keyword>lock</keyword>
  126.       <keyword>new</keyword>
  127.       <keyword>requires</keyword>
  128.       <keyword>return</keyword>
  129.       <keyword>set</keyword>
  130.       <keyword>sizeof</keyword>
  131.       <keyword>switch</keyword>
  132.       <keyword>this</keyword>
  133.       <keyword>throw</keyword>
  134.       <keyword>throws</keyword>
  135.       <keyword>try</keyword>
  136.       <keyword>typeof</keyword>
  137.       <keyword>value</keyword>
  138.       <keyword>var</keyword>
  139.       <keyword>void</keyword>
  140.       <keyword>while</keyword>
  141.     </context>
  142.  
  143.     <context id="primitives" style-ref="type">
  144.       <keyword>bool</keyword>
  145.       <keyword>char</keyword>
  146.       <keyword>double</keyword>
  147.       <keyword>float</keyword>
  148.       <keyword>int</keyword>
  149.       <keyword>int8</keyword>
  150.       <keyword>int16</keyword>
  151.       <keyword>int32</keyword>
  152.       <keyword>int64</keyword>
  153.       <keyword>long</keyword>
  154.       <keyword>short</keyword>
  155.       <keyword>size_t</keyword>
  156.       <keyword>ssize_t</keyword>
  157.       <keyword>string</keyword>
  158.       <keyword>uchar</keyword>
  159.       <keyword>uint</keyword>
  160.       <keyword>uint8</keyword>
  161.       <keyword>uint16</keyword>
  162.       <keyword>uint32</keyword>
  163.       <keyword>uint64</keyword>
  164.       <keyword>ulong</keyword>
  165.       <keyword>unichar</keyword>
  166.       <keyword>ushort</keyword>
  167.     </context>
  168.  
  169.     <context id="null-value" style-ref="null-value">
  170.       <keyword>null</keyword>
  171.     </context>
  172.  
  173.     <context id="boolean" style-ref="boolean">
  174.       <keyword>false</keyword>
  175.       <keyword>true</keyword>
  176.     </context>
  177.  
  178.     <context id="decimal" style-ref="decimal">
  179.       <match extended="true">
  180.         (?<![\w\.])
  181.         [0-9]+[uUlL]*
  182.         (?![\w\.])
  183.       </match>
  184.     </context>
  185.  
  186.     <context id="hexadecimal" style-ref="hexadecimal">
  187.       <match extended="true">
  188.         (?<![\w\.])
  189.         0[xX][a-fA-F0-9]+[uUlL]*
  190.         (?![\w\.])
  191.       </match>
  192.     </context>
  193.  
  194.     <context id="real" style-ref="real">
  195.       <match extended="true">
  196.         (?<![\w\.])
  197.         ((\.[0-9]+|[0-9]+\.[0-9]*)([Ee][+-]?[0-9]*)?[FfDdMm]?|
  198.          ([0-9]+[Ee][+-]?[0-9]*)[FfDdMm]? |
  199.          ([0-9]+)[FfDdMm])
  200.         (?![\w\.])
  201.       </match>
  202.     </context>
  203.  
  204.     <context id="vala">
  205.       <include>
  206.         <context ref="def:string"/>
  207.         <context ref="def:single-quoted-string"/>
  208.         <context ref="line-comment"/>
  209.         <context ref="multiline-comment"/>
  210.         <context ref="close-comment-outside-comment"/>
  211.         <context ref="multiline-string"/>
  212.         <context ref="keywords"/>
  213.         <context ref="primitives"/>
  214.         <context ref="null-value"/>
  215.         <context ref="boolean"/>
  216.         <context ref="decimal"/>
  217.         <context ref="hexadecimal"/>
  218.         <context ref="real"/>
  219.       </include>
  220.     </context>
  221.   </definitions>
  222. </language>
  223.